//using System;
//using System.IO;
//using System.Collections.Generic;
//using System.Text;

//using Microsoft.DirectX.Direct3D;

//using TTDotNet.Util;
//using TTDotNet.Engine.Create.Tools;
//using TTDotNet.Engine.Create.Events;
//using TTDotNet.Engine.Create.Actions;

//namespace TTDotNet.Engine.GUI
//{
//    public class ButtonManager
//    {
//        //List<GameButton> mainButtons;
//        Dictionary<string, GameButton2> mainButtons;
        
//        public ButtonManager()
//        {
//            mainButtons = new Dictionary<string, GameButton2>();
//            LoadButtons();
//        }

//        public GameButton2 ButtonCheck()
//        {
//            return null;
//        }

//        public IEnumerator<GameButton2> GetEnumerator()
//        {
//            foreach (GameButton2 button in mainButtons.Values)
//            {
//                yield return button;
//            }
//        }

//        private void LoadButtons()
//        {
//            string path = "../../data/buttons/buttons.dat";

//            string str = null;

//            int left = 0;

//            try
//            {
//                if (File.Exists(path))
//                {
//                    FileStream buttonIn = new FileStream(path, FileMode.Open);
//                    StreamReader sr = new StreamReader(buttonIn);

//                    while ((str = sr.ReadLine()) != null)
//                    {
//                        int width = MakeButton(str, new Coordinate(left, 0));
//                        left += (width);
//                    }

//                    sr.Close();
//                    buttonIn.Close();
//                }
//                else
//                {
//                    System.Windows.Forms.MessageBox.Show("Error loading buttons file");
//                }


//            }
//            catch (Exception e) { }

//           // SetupEvents();
//        }

//        private int MakeButton(string str, Coordinate coord)
//        {   
//            string[] delims = { "," };
//            int width = -1;

//            try
//            {
//                string[] data = str.Trim().Split(delims, StringSplitOptions.None);

//                if (data.Length != 7)
//                {
//                    System.Windows.Forms.MessageBox.Show("Error loading buttons\n Line: " + str + " is malformed.");
//                }
//                else
//                {
//                    int bWidth = Int32.Parse(data[3]);
//                    int bHeight = Int32.Parse(data[4]);

//                    Background bg = new Background(data[2]);

//                    GameButton2 button = new GameButton2(bg, coord, data[0], data[1]);
//                    button.SetSize(bWidth, bHeight);

//                    mainButtons[button.Name] = button;

//                    width = bWidth + Int32.Parse(data[5]);
//                }
//            }
//            catch (Exception e)
//            {

//            }

//            return width;

//        }

//        private void SetupEvents()
//        {
//            GameEvent zoomInEvent = new GameEvent();
//            ZoomInAction zoomInAction = new ZoomInAction();
//            zoomInEvent.SetAction(zoomInAction);
//            zoomInEvent.SetTool(Toolbox.nullTool);
//            mainButtons["Zoom In"].ClickEvent = zoomInEvent;

//            GameEvent zoomOutEvent = new GameEvent();
//            ZoomOutAction zoomOutAction = new ZoomOutAction();
//            zoomOutEvent.SetAction(zoomOutAction);
//            zoomOutEvent.SetTool(Toolbox.nullTool);
//            mainButtons["Zoom Out"].ClickEvent = zoomOutEvent;

//            GameEvent pauseEvent = new GameEvent();
//            PauseAction pauseAction = new PauseAction();
//            pauseEvent.SetAction(pauseAction);
//            pauseEvent.SetTool(Toolbox.nullTool);
//            mainButtons["Pause"].ClickEvent = pauseEvent;

//            GameEvent roadConcEvent = new GameEvent();
//            RoadConcAction roadConcAction = new RoadConcAction();
//            roadConcEvent.SetAction(roadConcAction);
//            roadConcEvent.SetTool(Toolbox.nullTool);
//            mainButtons["Road Construction"].ClickEvent = roadConcEvent;
//        }


//    }
//}
